package com.example.websocket.mapper;

import com.example.websocket.pojo.LoginDTO;
import com.example.websocket.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @ author 韩
 * time: 2024/2/16 21:11
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where username=#{username}")
    User selectByUserName(String username);



    @Insert("insert into user(username,password) values(#{username},#{password})")
    boolean addUser(String username,String password);

    @Select("select `username` from user")
    List<String> getList();

}
